<?php
    $this->load->view("fungsiPenting.php");
    
    foreach($getDetail as $z){
        $zSdate   		   = $z["SO_SDATE"];
		$zEdate   		   = $z["SO_EDATE"];
		$zShours   		   = $z["SO_SHOURS"];
		$zEhours   		   = $z["SO_EHOURS"];
		$zShoure   		   = $z["SO_SHOURE"];
		$zEhoure   		   = $z["SO_EHOURE"];
		$zDescription      = $z["SO_DESCRIPTION"];
		$zAc   			   = $z["SO_AC"];
		$zLift   		   = $z["SO_LIFT"];
		$zLighting   	   = $z["SO_LIGHTING"];
		$zOther   		   = $z["SO_OTHER"];
		$zOtherDescription = $z["SO_OTHER_DESCRIPTION"];
		$zComment   	   = $z["SO_COMMENT"];
		$zAtasanNik   		= $z["SO_ATASAN_NIK"];
		$zUntukNik   		= $z["SO_UNTUK_NIK"];
		$zAtasanNama   		= $z["ATASANNAME"];
		
		$cName				= $z["NIKNAME"];
		$cJob				= $z["NIKJOBPOSITION"];
		$cOrg				= $z["NIKORG"];
    }
    foreach($getDetailPhone as $a){
        $aMsisdn = $a['MSISDN'];
    }
?>
<!--
<div class="container" style="margin-top:40px">
-->
	<div class="col-md-offset-0" id="top">
	<div class="col-md-11">
	<div id="report" class="panel panel-default">
		<div class="panel-heading">
		<h4 class="panel-title"><b> Overtime</b></h4>
		
		<div class="btn-group pull-right">
			<button class="btn btn-default btn-sm" id="btnExport"><i class="icon-file-excel on-left"></i> Excel</button>
			<button class="btn btn-default btn-sm" type='button' value='Print' onclick="printDiv('tblExport');"><i class="icon-printer on-left"></i> Print</button>
		</div>
		
		</div>
		<div class="panel-body" id="tblExport">	
			<div class="row">
				<div class="col-sm-4">
					<img class="img-responsive" src="<?php echo base_url() ?>static/images/logo_telkomsel.png">
				</div>
				<div class="col-sm-4" align="center">
                    <h3>
                    <?php echo $cRequestNo;?>
                    </h3>
				</div>
				<div class="col-sm-4"></div>
			</div>
			<br />
			
			<div class="row">
				<div class="col-sm-12">
					<div class="table-responsive" style="border: none;">
						<table class="table" style="border: none;">
                        <!--<table>-->
							
							<tr>
								<td width="30%">No Order</td>           <td width="5%">:</td>         <td width="65%"><?php echo $cRequestNo;?></td>
                            </tr>
                            <tr>
								<td width="30%">Requestor</td>          <td width="5%">:</td>         <td width="65%"><?php echo $cName;?></td>
                            </tr>
                            <tr>    
								<td width="30%">Nik</td>                <td width="5%">:</td>         <td width="65%"><?php echo $zUntukNik;?></td>
                            </tr>
                            <tr>    
                                <td width="30%">No. Hp</td>             <td width="5%">:</td>         <td width="65%"><?php echo $aMsisdn;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Tanggal</td>            <td width="5%">:</td>         <td width="65%"><?php echo $zSdate.":".$zEdate;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Jam</td>                <td width="5%">:</td>         <td width="65%"><?php echo $zShours.":".$zEhours." - ".$zShoure.":".$zEhoure?></td>
                            </tr>
                            <tr>
                                <td width="30%">Facility</td>           <td width="5%">:</td>         <td width="65%">
                                    <input name="pAc" type="checkbox" value="Y" <?php if($zAc=="Y"){?>checked=""<?php }?> disabled="" /> &nbsp;Air Conditioner<br/>
        							<input name="pLift" type="checkbox" value="Y" <?php if($zLift=="Y"){?>checked=""<?php }?> disabled=""/>&nbsp;Service Lift<br/>
        							<input name="pLighting" type="checkbox" value="Y" <?php if($zLighting=="Y"){?>checked=""<?php }?> disabled=""/>&nbsp;Lighting &amp; Power
                                </td>
                            </tr>
                            <tr>
                                <td width="30%">Keterangan</td>         <td width="5%">:</td>         <td width="65%"><?php echo $zDescription;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Overtime Name</td>      <td width="5%">:</td>         <td width="65%">
                                    <div class="table-responsive" style="border: none;">
						                  <table class="table" style="border: none;">
                                                <tr>
                                                    <td>No</td>
                                                    <td>Nama</td>
                                                    <td>Lantai</td>
                                                    <td>Ruang</td>
                                                    <td>Company</td>
                                                </tr>
                                                <?php
                                                $i=0;
                                                $no=1;
                                                foreach($getDetailName as $b){
                                                    $bSodId   		= $b["SOD_ID"];							
                        						    $bSodName   	= $b["SOD_NAME"];
                        							$bSodFloor   	= $b["SOD_FLOOR"];
                        							$bSodLocation   = $b["SOD_LOCATION"];
                        							$bSodVendorId   = $b["SOD_VENDOR_ID"];
                        							$bSodVendorName = $b["SOD_VENDOR_NAME"];
                        							$bSoId   		= $b["SO_ID"];
                                                ?>
                                                <tr>
                                                    <td><?php echo $no;?></td>
                                                    <td><?php echo $bSodName;?></td>
                                                    <td><?php echo $bSodFloor;?></td>
                                                    <td><?php echo $bSodLocation;?></td>
                                                    <td><?php echo $bSodVendorName;?></td>
                                                </tr>
                                                <?php
                                                    $i++;
                                                    $no++;
                                                }
                                                ?>
                                          </table>
                                    </div>                                
                                </td>
                            </tr>
                            <tr>
                                <td width="30%">Nama Atasan</td>        <td width="5%">:</td>         <td width="65%"><?php echo $zAtasanNama;?></td>
                            </tr>
                            <tr>
                                <td width="30%">Comment</td>            <td width="5%">:</td>         <td width="65%"><?php echo nl2br($zComment);?></td>
                            </tr>
						</table>
					</div>
					
				</div>
			</div>
			
		</div>
	</div>
	</div>
	</div>
<!--</div>-->

<script>
	$(function() {
		$("input[id^='datepicker']").datetimepicker({
			scrollInput: false,
			yearOffset:0,
			lang:'en',
			timepicker:false,
			datepicker:true,
			format:'d-m-Y',
			formatDate:'d/m/Y',
			/*minDate:'-1970/01/01',
			onGenerate:function( ct ){
				$(this).find('.xdsoft_date.xdsoft_weekend')
					.addClass('xdsoft_disabled');
			}*/
		});
	});
</script>
<script>
    $(document).ready(function () {
        $("#btnExport").click(function () {
            $("#tblExport").btechco_excelexport({
                containerid: "tblExport"
               , datatype: $datatype.Table
               , filename: 'Report_Coordination_<?php echo str_replace("-","",$this->input->post('date_start'))."-".str_replace("-","",$this->input->post('date_end')); ?>'
            });
			
        });
		
    });
</script>
<script>
	function printDiv(divName) 
	{
		var printContents = document.getElementById(divName).innerHTML;     
		var originalContents = document.body.innerHTML;       
		document.body.innerHTML = printContents;      
		window.print();      
		document.body.innerHTML = originalContents;
		window.parent.reload();
   }
</script>
<style type="text/css">
table { border-collapse:collapse; width:100%;}
table td, table th { border:1px solid #ddd; padding:2px; }

table { page-break-inside:auto }
tr    { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }

.table > tbody > tr > td {
	padding: 3px;
}
</style>

